package top.xiaoshuaila.searescue.controller;

import com.alibaba.fastjson.JSONObject;
import gnu.io.SerialPort;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import top.xiaoshuaila.searescue.serialport.manager.SerialPortManager;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@Controller
@RequestMapping("/Port")
public class Portsetting {

    private SerialPort serialPort;
    @GetMapping("/getAll")
    public List<String> getall(){
        return SerialPortManager.findPorts();
    }
}
